<!DOCTYPE html>
<html lang=zh>
<head>
  <meta charset="utf-8">
  
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-transform" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="format-detection" content="telephone=no,email=no,adress=no">
  <!-- Color theme for statusbar -->
  <meta name="theme-color" content="#000000" />
  <!-- 强制页面在当前窗口以独立页面显示,防止别人在框架里调用页面 -->
  <meta http-equiv="window-target" content="_top" />
  
  
  <title>ElasticSearch RestFul API接口 | 知识是最有价值的东西</title>
  <meta name="description" content="ElasticSearch RestFul API接口参考资料：https:&#x2F;&#x2F;www.cnblogs.com&#x2F;ljhdo&#x2F;p&#x2F;4959412.html 实例集群查看 ES 信息基本信息接口名称：查看 ES 信息 接口路径：http:&#x2F;&#x2F;localhost:9200 请求方式：GET 请求参数Headers    参数名称 参数类型 参数值 是否必须 示例 备注            Query">
<meta property="og:type" content="article">
<meta property="og:title" content="ElasticSearch RestFul API接口">
<meta property="og:url" content="http:&#x2F;&#x2F;jirenyou.gitee.io&#x2F;blog&#x2F;2020&#x2F;01&#x2F;02&#x2F;elasticsearch&#x2F;es-rest-api&#x2F;index.html">
<meta property="og:site_name" content="知识是最有价值的东西">
<meta property="og:description" content="ElasticSearch RestFul API接口参考资料：https:&#x2F;&#x2F;www.cnblogs.com&#x2F;ljhdo&#x2F;p&#x2F;4959412.html 实例集群查看 ES 信息基本信息接口名称：查看 ES 信息 接口路径：http:&#x2F;&#x2F;localhost:9200 请求方式：GET 请求参数Headers    参数名称 参数类型 参数值 是否必须 示例 备注            Query">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-01-02T12:24:15.000Z">
<meta property="article:modified_time" content="2020-01-02T12:24:15.000Z">
<meta property="article:author" content="Jirry">
<meta property="article:tag" content="elasticsearch">
<meta name="twitter:card" content="summary">
  <!-- Canonical links -->
  <link rel="canonical" href="http://jirenyou.gitee.io/blog/2020/01/02/elasticsearch/es-rest-api/index.html">
  
    <link rel="alternate" href="/atom.xml" title="知识是最有价值的东西" type="application/atom+xml">
  
  
    <link rel="icon" href="/blog/favicon.ico" type="image/x-icon">
  
  
<link rel="stylesheet" href="/blog/css/style.css">

  
  
  
  
<meta name="generator" content="Hexo 4.1.0"></head>


<body class="main-center theme-black" itemscope itemtype="http://schema.org/WebPage">
  <header class="header" itemscope itemtype="http://schema.org/WPHeader">
  <div class="slimContent">
    <div class="navbar-header">
      
      
      <div class="profile-block text-center">
        <a id="avatar" href="https://jirenyou.gitee.io/blog" target="_blank">
          <img class="img-circle img-rotate" src="/blog/images/avatar.jpg" width="200" height="200">
        </a>
        <h2 id="name" class="hidden-xs hidden-sm">Jirry</h2>
        <h3 id="title" class="hidden-xs hidden-sm hidden-md">Back end development Architecture</h3>
        <small id="location" class="text-muted hidden-xs hidden-sm"><i class="icon icon-map-marker"></i> Shenzhen, China</small>
      </div>
      
      <div class="search" id="search-form-wrap">

    <form class="search-form sidebar-form">
        <div class="input-group">
            <input type="text" class="search-form-input form-control" placeholder="搜索" />
            <span class="input-group-btn">
                <button type="submit" class="search-form-submit btn btn-flat" onclick="return false;"><i class="icon icon-search"></i></button>
            </span>
        </div>
    </form>
    <div class="ins-search">
  <div class="ins-search-mask"></div>
  <div class="ins-search-container">
    <div class="ins-input-wrapper">
      <input type="text" class="ins-search-input" placeholder="想要查找什么..." x-webkit-speech />
      <button type="button" class="close ins-close ins-selectable" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
    </div>
    <div class="ins-section-wrapper">
      <div class="ins-section-container"></div>
    </div>
  </div>
</div>


</div>
      <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#main-navbar" aria-controls="main-navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>
    <nav id="main-navbar" class="collapse navbar-collapse" itemscope itemtype="http://schema.org/SiteNavigationElement" role="navigation">
      <ul class="nav navbar-nav main-nav ">
        
        
        <li class="menu-item menu-item-home">
          <a href="/blog/.">
            
            <i class="icon icon-home-fill"></i>
            
            <span class="menu-title">首页</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-archives">
          <a href="/blog/archives">
            
            <i class="icon icon-archives-fill"></i>
            
            <span class="menu-title">归档</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-categories">
          <a href="/blog/categories">
            
            <i class="icon icon-folder"></i>
            
            <span class="menu-title">分类</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-tags">
          <a href="/blog/tags">
            
            <i class="icon icon-tags"></i>
            
            <span class="menu-title">标签</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-repository">
          <a href="/blog/repository">
            
            <i class="icon icon-project"></i>
            
            <span class="menu-title">项目</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-links">
          <a href="/blog/links">
            
            <i class="icon icon-friendship"></i>
            
            <span class="menu-title">友链</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-about">
          <a href="/blog/about">
            
            <i class="icon icon-cup-fill"></i>
            
            <span class="menu-title">关于</span>
          </a>
        </li>
        
      </ul>
      
	
    <ul class="social-links">
    	
        <li><a href="https://github.com/jirryji" target="_blank" title="Github" data-toggle=tooltip data-placement=top><i class="icon icon-github"></i></a></li>
        
        <li><a href="https://weibo.com/7355950025" target="_blank" title="Weibo" data-toggle=tooltip data-placement=top><i class="icon icon-weibo"></i></a></li>
        
        <li><a href="/blog/atom.xml" target="_blank" title="Rss" data-toggle=tooltip data-placement=top><i class="icon icon-rss"></i></a></li>
        
    </ul>

    </nav>
  </div>
</header>

  
    <aside class="sidebar" itemscope itemtype="http://schema.org/WPSideBar">
  <div class="slimContent">
    
      <div class="widget">
    <h3 class="widget-title">公告</h3>
    <div class="widget-body">
        <div id="board">
            <div class="content">
                <p>欢迎交流与分享经验!</p>
            </div>
        </div>
    </div>
</div>

    
      
  <div class="widget">
    <h3 class="widget-title">分类</h3>
    <div class="widget-body">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/blog/categories/docker/">docker</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/elasticsearch/">elasticsearch</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/java/">java</a><span class="category-list-count">9</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/php/">php</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6/">版本控制</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/%E8%AF%AD%E6%B3%95/">语法</a><span class="category-list-count">1</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/blog/categories/%E8%AF%AD%E6%B3%95/markdown-%E8%AF%AD%E6%B3%95/">markdown 语法</a><span class="category-list-count">1</span></li></ul></li></ul>
    </div>
  </div>


    
      
  <div class="widget">
    <h3 class="widget-title">标签</h3>
    <div class="widget-body">
      <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/aop/" rel="tag">aop</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/bloom-filter/" rel="tag">bloom-filter</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/busybox/" rel="tag">busybox</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/docker/" rel="tag">docker</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/elasticsearch/" rel="tag">elasticsearch</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/es/" rel="tag">es</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/filter/" rel="tag">filter</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/git/" rel="tag">git</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/hashMap/" rel="tag">hashMap</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/idea/" rel="tag">idea</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/interceptor/" rel="tag">interceptor</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/iterator/" rel="tag">iterator</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/java/" rel="tag">java</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/localDateTime/" rel="tag">localDateTime</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/map/" rel="tag">map</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/markdown/" rel="tag">markdown</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/maven/" rel="tag">maven</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/redis/" rel="tag">redis</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/redis-lua%E8%84%9A%E6%9C%AC/" rel="tag">redis lua脚本</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/volumes/" rel="tag">volumes</a><span class="tag-list-count">1</span></li></ul>
    </div>
  </div>


    
      
  <div class="widget">
    <h3 class="widget-title">标签云</h3>
    <div class="widget-body tagcloud">
      <a href="/blog/tags/aop/" style="font-size: 13px;">aop</a> <a href="/blog/tags/bloom-filter/" style="font-size: 13px;">bloom-filter</a> <a href="/blog/tags/busybox/" style="font-size: 13px;">busybox</a> <a href="/blog/tags/docker/" style="font-size: 14px;">docker</a> <a href="/blog/tags/elasticsearch/" style="font-size: 13.67px;">elasticsearch</a> <a href="/blog/tags/es/" style="font-size: 13px;">es</a> <a href="/blog/tags/filter/" style="font-size: 13.33px;">filter</a> <a href="/blog/tags/git/" style="font-size: 13.33px;">git</a> <a href="/blog/tags/hashMap/" style="font-size: 13px;">hashMap</a> <a href="/blog/tags/idea/" style="font-size: 13px;">idea</a> <a href="/blog/tags/interceptor/" style="font-size: 13px;">interceptor</a> <a href="/blog/tags/iterator/" style="font-size: 13px;">iterator</a> <a href="/blog/tags/java/" style="font-size: 13.67px;">java</a> <a href="/blog/tags/localDateTime/" style="font-size: 13px;">localDateTime</a> <a href="/blog/tags/map/" style="font-size: 13px;">map</a> <a href="/blog/tags/markdown/" style="font-size: 13px;">markdown</a> <a href="/blog/tags/maven/" style="font-size: 13.67px;">maven</a> <a href="/blog/tags/redis/" style="font-size: 13px;">redis</a> <a href="/blog/tags/redis-lua%E8%84%9A%E6%9C%AC/" style="font-size: 13px;">redis lua脚本</a> <a href="/blog/tags/volumes/" style="font-size: 13px;">volumes</a>
    </div>
  </div>

    
      
  <div class="widget">
    <h3 class="widget-title">归档</h3>
    <div class="widget-body">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2020/01/">一月 2020</a><span class="archive-list-count">9</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2019/12/">十二月 2019</a><span class="archive-list-count">11</span></li></ul>
    </div>
  </div>


    
      
  <div class="widget">
    <h3 class="widget-title">最新文章</h3>
    <div class="widget-body">
      <ul class="recent-post-list list-unstyled no-thumbnail">
        
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="/blog/categories/java/">java</a>
              </p>
              <p class="item-title">
                <a href="/blog/2020/01/14/java/maven/mvn-private-repo/" class="title">Maven私服（Nexus）搭建</a>
              </p>
              <p class="item-date">
                <time datetime="2020-01-14T13:37:39.000Z" itemprop="datePublished">2020-01-14</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="/blog/categories/java/">java</a>
              </p>
              <p class="item-title">
                <a href="/blog/2020/01/09/java/java-idea-start-slow/" class="title">解决Idea启动Spring Boot很慢的问题</a>
              </p>
              <p class="item-date">
                <time datetime="2020-01-09T15:24:15.000Z" itemprop="datePublished">2020-01-09</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="/blog/categories/java/">java</a>
              </p>
              <p class="item-title">
                <a href="/blog/2020/01/09/java/java-springboot-filter-in-aop/" class="title">AOP（面向切面编程）、Filter（过虑器）、Interceptor（拦截器）</a>
              </p>
              <p class="item-date">
                <time datetime="2020-01-09T15:24:15.000Z" itemprop="datePublished">2020-01-09</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="/blog/categories/java/">java</a>
              </p>
              <p class="item-title">
                <a href="/blog/2020/01/09/java/java-req-resp/" class="title">HttpServletRequest 与 HttpServletResponse 的实现类</a>
              </p>
              <p class="item-date">
                <time datetime="2020-01-09T08:24:15.000Z" itemprop="datePublished">2020-01-09</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="/blog/categories/java/">java</a>
              </p>
              <p class="item-title">
                <a href="/blog/2020/01/09/java/java-springboot-filter/" class="title">Spring Boot 过滤器 Filter</a>
              </p>
              <p class="item-date">
                <time datetime="2020-01-09T08:24:15.000Z" itemprop="datePublished">2020-01-09</time>
              </p>
            </div>
          </li>
          
      </ul>
    </div>
  </div>
  

    
  </div>
</aside>

  
  
<aside class="sidebar sidebar-toc collapse" id="collapseToc" itemscope itemtype="http://schema.org/WPSideBar">
  <div class="slimContent">
    <nav id="toc" class="article-toc">
      <h3 class="toc-title">文章目录</h3>
      <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#ElasticSearch-RestFul-API接口"><span class="toc-number">1.</span> <span class="toc-text">ElasticSearch RestFul API接口</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#实例集群"><span class="toc-number">1.1.</span> <span class="toc-text">实例集群</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#查看-ES-信息"><span class="toc-number">1.1.1.</span> <span class="toc-text">查看 ES 信息</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#基本信息"><span class="toc-number">1.1.1.1.</span> <span class="toc-text">基本信息</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#请求参数"><span class="toc-number">1.1.1.2.</span> <span class="toc-text">请求参数</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#响应数据"><span class="toc-number">1.1.1.3.</span> <span class="toc-text">响应数据</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#查看集群健康状态"><span class="toc-number">1.1.2.</span> <span class="toc-text">查看集群健康状态</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#基本信息-1"><span class="toc-number">1.1.2.1.</span> <span class="toc-text">基本信息</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#请求参数-1"><span class="toc-number">1.1.2.2.</span> <span class="toc-text">请求参数</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#响应数据-1"><span class="toc-number">1.1.2.3.</span> <span class="toc-text">响应数据</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#查看分片信息"><span class="toc-number">1.1.3.</span> <span class="toc-text">查看分片信息</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#基本信息-2"><span class="toc-number">1.1.3.1.</span> <span class="toc-text">基本信息</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#请求参数-2"><span class="toc-number">1.1.3.2.</span> <span class="toc-text">请求参数</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#响应数据-2"><span class="toc-number">1.1.3.3.</span> <span class="toc-text">响应数据</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#索引"><span class="toc-number">1.2.</span> <span class="toc-text">索引</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#查询所有索引"><span class="toc-number">1.2.1.</span> <span class="toc-text">查询所有索引</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#基本信息-3"><span class="toc-number">1.2.1.1.</span> <span class="toc-text">基本信息</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#请求参数-3"><span class="toc-number">1.2.1.2.</span> <span class="toc-text">请求参数</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#响应数据-3"><span class="toc-number">1.2.1.3.</span> <span class="toc-text">响应数据</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#添加索引"><span class="toc-number">1.2.2.</span> <span class="toc-text">添加索引</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#基本信息-4"><span class="toc-number">1.2.2.1.</span> <span class="toc-text">基本信息</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#请求参数-4"><span class="toc-number">1.2.2.2.</span> <span class="toc-text">请求参数</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#响应数据-4"><span class="toc-number">1.2.2.3.</span> <span class="toc-text">响应数据</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#删除索引"><span class="toc-number">1.2.3.</span> <span class="toc-text">删除索引</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#基本信息-5"><span class="toc-number">1.2.3.1.</span> <span class="toc-text">基本信息</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#请求参数-5"><span class="toc-number">1.2.3.2.</span> <span class="toc-text">请求参数</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#响应数据-5"><span class="toc-number">1.2.3.3.</span> <span class="toc-text">响应数据</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#映射"><span class="toc-number">1.3.</span> <span class="toc-text">映射</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#查看所有索引所有映射"><span class="toc-number">1.3.1.</span> <span class="toc-text">查看所有索引所有映射</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#基本信息-6"><span class="toc-number">1.3.1.1.</span> <span class="toc-text">基本信息</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#请求参数-6"><span class="toc-number">1.3.1.2.</span> <span class="toc-text">请求参数</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#响应数据-6"><span class="toc-number">1.3.1.3.</span> <span class="toc-text">响应数据</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#查看单个索引所有映射"><span class="toc-number">1.3.2.</span> <span class="toc-text">查看单个索引所有映射</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#基本信息-7"><span class="toc-number">1.3.2.1.</span> <span class="toc-text">基本信息</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#请求参数-7"><span class="toc-number">1.3.2.2.</span> <span class="toc-text">请求参数</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#响应数据-7"><span class="toc-number">1.3.2.3.</span> <span class="toc-text">响应数据</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#查看单个索引单个映射"><span class="toc-number">1.3.3.</span> <span class="toc-text">查看单个索引单个映射</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#基本信息-8"><span class="toc-number">1.3.3.1.</span> <span class="toc-text">基本信息</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#请求参数-8"><span class="toc-number">1.3.3.2.</span> <span class="toc-text">请求参数</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#响应数据-8"><span class="toc-number">1.3.3.3.</span> <span class="toc-text">响应数据</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#添加映射"><span class="toc-number">1.3.4.</span> <span class="toc-text">添加映射</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#基本信息-9"><span class="toc-number">1.3.4.1.</span> <span class="toc-text">基本信息</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#请求参数-9"><span class="toc-number">1.3.4.2.</span> <span class="toc-text">请求参数</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#响应数据-9"><span class="toc-number">1.3.4.3.</span> <span class="toc-text">响应数据</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#分词器"><span class="toc-number">1.4.</span> <span class="toc-text">分词器</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#查看分词"><span class="toc-number">1.4.1.</span> <span class="toc-text">查看分词</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#基本信息-10"><span class="toc-number">1.4.1.1.</span> <span class="toc-text">基本信息</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#请求参数-10"><span class="toc-number">1.4.1.2.</span> <span class="toc-text">请求参数</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#响应数据-10"><span class="toc-number">1.4.1.3.</span> <span class="toc-text">响应数据</span></a></li></ol></li></ol></li></ol></li></ol>
    </nav>
  </div>
</aside>

<main class="main" role="main">
  <div class="content">
  <article id="post-elasticsearch/es-rest-api" class="article article-type-post" itemscope itemtype="http://schema.org/BlogPosting">
    
    <div class="article-header">
      
        
  
    <h1 class="article-title" itemprop="name">
      ElasticSearch RestFul API接口
    </h1>
  

      
      <div class="article-meta">
        <span class="article-date">
    <i class="icon icon-calendar-check"></i>
	<a href="/blog/2020/01/02/elasticsearch/es-rest-api/" class="article-date">
	  <time datetime="2020-01-02T12:24:15.000Z" itemprop="datePublished">2020-01-02</time>
	</a>
</span>
        
  <span class="article-category">
    <i class="icon icon-folder"></i>
    <a class="article-category-link" href="/blog/categories/elasticsearch/">elasticsearch</a>
  </span>

        
  <span class="article-tag">
    <i class="icon icon-tags"></i>
	<a class="article-tag-link" href="/blog/tags/elasticsearch/" rel="tag">elasticsearch</a>
  </span>


        
	<span class="article-read hidden-xs">
	    <i class="icon icon-eye-fill" aria-hidden="true"></i>
	    <span id="busuanzi_container_page_pv">
			<span id="busuanzi_value_page_pv">0</span>
		</span>
	</span>


        <span class="post-comment"><i class="icon icon-comment"></i> <a href="/blog/2020/01/02/elasticsearch/es-rest-api/#comments" class="article-comment-link">评论</a></span>
        
	
	

      </div>
    </div>
    <div class="article-entry marked-body" itemprop="articleBody">
      
        <h1 id="ElasticSearch-RestFul-API接口"><a href="#ElasticSearch-RestFul-API接口" class="headerlink" title="ElasticSearch RestFul API接口"></a>ElasticSearch RestFul API接口</h1><p>参考资料：<a href="https://www.cnblogs.com/ljhdo/p/4959412.html" target="_blank" rel="noopener">https://www.cnblogs.com/ljhdo/p/4959412.html</a></p>
<h2 id="实例集群"><a href="#实例集群" class="headerlink" title="实例集群"></a>实例集群</h2><h3 id="查看-ES-信息"><a href="#查看-ES-信息" class="headerlink" title="查看 ES 信息"></a>查看 ES 信息</h3><h4 id="基本信息"><a href="#基本信息" class="headerlink" title="基本信息"></a>基本信息</h4><p><strong>接口名称：</strong>查看 ES 信息</p>
<p><strong>接口路径：</strong><a href="http://localhost:9200" target="_blank" rel="noopener">http://localhost:9200</a></p>
<p><strong>请求方式：</strong>GET</p>
<h4 id="请求参数"><a href="#请求参数" class="headerlink" title="请求参数"></a>请求参数</h4><p><strong>Headers</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>参数值</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>Query</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>Body</strong></p>
<figure class="highlight json"><table><tr><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="code"><pre><span class="line"></span></pre></td></tr></table></figure>

<h4 id="响应数据"><a href="#响应数据" class="headerlink" title="响应数据"></a>响应数据</h4><figure class="highlight json"><table><tr><td class="code"><pre><span class="line">&#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"name"</span>: <span class="string">"master"</span>,	<span class="comment">// 节点名称</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"cluster_name"</span>: <span class="string">"cluster_es"</span>,	<span class="comment">// 集群名称</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"cluster_uuid"</span>: <span class="string">"_Q25PmWXQCiN-wQSJiG0ww"</span>,	<span class="comment">// 集群ID</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"version"</span>: &#123;	<span class="comment">// 版本信息</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">    <span class="attr">"number"</span>: <span class="string">"5.6.12"</span>,	<span class="comment">// 版本号</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">    <span class="attr">"build_hash"</span>: <span class="string">"cfe3d9f"</span>,	<span class="comment">// 构建hash</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">    <span class="attr">"build_date"</span>: <span class="string">"2018-09-10T20:12:43.732Z"</span>,	<span class="comment">// 构建时间</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">    <span class="attr">"build_snapshot"</span>: <span class="literal">false</span>,	<span class="comment">// 构建快照</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">    <span class="attr">"lucene_version"</span>: <span class="string">"6.6.1"</span>	<span class="comment">// lucene 版本</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">  &#125;,</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"tagline"</span>: <span class="string">"You Know, for Search"</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">&#125;</span></pre></td></tr></table></figure>

<h3 id="查看集群健康状态"><a href="#查看集群健康状态" class="headerlink" title="查看集群健康状态"></a>查看集群健康状态</h3><h4 id="基本信息-1"><a href="#基本信息-1" class="headerlink" title="基本信息"></a>基本信息</h4><p><strong>接口名称：</strong>_cluster/health 查看集群健康状态</p>
<p><strong>接口路径：</strong><a href="http://localhost:9200/_cluster/health" target="_blank" rel="noopener">http://localhost:9200/_cluster/health</a></p>
<p><strong>请求方式：</strong>GET</p>
<h4 id="请求参数-1"><a href="#请求参数-1" class="headerlink" title="请求参数"></a>请求参数</h4><p><strong>Headers</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>参数值</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>Query</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>pretty</td>
<td>String</td>
<td>否</td>
<td>true</td>
<td>美化输出</td>
</tr>
</tbody></table>
<p><strong>Body</strong></p>
<figure class="highlight json"><table><tr><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="code"><pre><span class="line"></span></pre></td></tr></table></figure>

<h4 id="响应数据-1"><a href="#响应数据-1" class="headerlink" title="响应数据"></a>响应数据</h4><figure class="highlight json"><table><tr><td class="code"><pre><span class="line">&#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"cluster_name"</span>: <span class="string">"cluster_es"</span>,	</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"status"</span>: <span class="string">"green"</span>,	</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"timed_out"</span>: <span class="literal">false</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"number_of_nodes"</span>: <span class="number">1</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"number_of_data_nodes"</span>: <span class="number">1</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"active_primary_shards"</span>: <span class="number">2</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"active_shards"</span>: <span class="number">2</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"relocating_shards"</span>: <span class="number">0</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"initializing_shards"</span>: <span class="number">0</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"unassigned_shards"</span>: <span class="number">0</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"delayed_unassigned_shards"</span>: <span class="number">0</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"number_of_pending_tasks"</span>: <span class="number">0</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"number_of_in_flight_fetch"</span>: <span class="number">0</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"task_max_waiting_in_queue_millis"</span>: <span class="number">0</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"active_shards_percent_as_number"</span>: <span class="number">100.0</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">&#125;</span></pre></td></tr></table></figure>

<h3 id="查看分片信息"><a href="#查看分片信息" class="headerlink" title="查看分片信息"></a>查看分片信息</h3><h4 id="基本信息-2"><a href="#基本信息-2" class="headerlink" title="基本信息"></a>基本信息</h4><p><strong>接口名称：</strong>_cat/shards查看分片信息</p>
<p><strong>接口路径：</strong><a href="http://localhost:9200/_cat/shards" target="_blank" rel="noopener">http://localhost:9200/_cat/shards</a></p>
<p><strong>请求方式：</strong>GET</p>
<h4 id="请求参数-2"><a href="#请求参数-2" class="headerlink" title="请求参数"></a>请求参数</h4><p><strong>Headers</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>参数值</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>Query</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>pretty</td>
<td>String</td>
<td>否</td>
<td>true</td>
<td>美化输出</td>
</tr>
<tr>
<td>v</td>
<td>String</td>
<td>否</td>
<td>true</td>
<td>详细信息</td>
</tr>
</tbody></table>
<p><strong>Body</strong></p>
<figure class="highlight json"><table><tr><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="code"><pre><span class="line"></span></pre></td></tr></table></figure>

<h4 id="响应数据-2"><a href="#响应数据-2" class="headerlink" title="响应数据"></a>响应数据</h4><figure class="highlight"><table><tr><td class="code"><pre><span class="line">index shard prirep state   docs store ip        node</span></pre></td></tr><tr><td class="code"><pre><span class="line">idx_2 0     p      STARTED    0  191b 127.0.0.1 master</span></pre></td></tr><tr><td class="code"><pre><span class="line">test  0     p      STARTED    0  191b 127.0.0.1 master</span></pre></td></tr></table></figure>

<h2 id="索引"><a href="#索引" class="headerlink" title="索引"></a>索引</h2><blockquote>
<p>ES的索引库是一个逻辑概念，它包括了分词列表及文档列表，同一个索引库中存储了相同类型的文档。它就相当于 MySQL 中的表，或相当于Mongodb中的集合。</p>
</blockquote>
<h3 id="查询所有索引"><a href="#查询所有索引" class="headerlink" title="查询所有索引"></a>查询所有索引</h3><h4 id="基本信息-3"><a href="#基本信息-3" class="headerlink" title="基本信息"></a>基本信息</h4><p><strong>接口名称：</strong>查询所有索引</p>
<p><strong>接口路径：</strong><a href="http://localhost:9200/_cat/indices" target="_blank" rel="noopener">http://localhost:9200/_cat/indices</a></p>
<p><strong>请求方式：</strong>GET</p>
<h4 id="请求参数-3"><a href="#请求参数-3" class="headerlink" title="请求参数"></a>请求参数</h4><p><strong>Headers</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>参数值</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>Query</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>v</td>
<td>String</td>
<td>否</td>
<td>true</td>
<td>详细信息</td>
</tr>
</tbody></table>
<p><strong>Body</strong></p>
<figure class="highlight json"><table><tr><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="code"><pre><span class="line"></span></pre></td></tr></table></figure>

<h4 id="响应数据-3"><a href="#响应数据-3" class="headerlink" title="响应数据"></a>响应数据</h4><figure class="highlight"><table><tr><td class="code"><pre><span class="line">health status index uuid                   pri rep docs.count docs.deleted store.size pri.store.size</span></pre></td></tr><tr><td class="code"><pre><span class="line">green  open   test  ny_SL8IlT6yo2CnpHdeMEw   1   0          0            0       191b           191b</span></pre></td></tr><tr><td class="code"><pre><span class="line">green  open   idx_2 t4t0med_SGC-BvBZwOQpLQ   1   0          0            0       191b           191b</span></pre></td></tr></table></figure>

<h3 id="添加索引"><a href="#添加索引" class="headerlink" title="添加索引"></a>添加索引</h3><h4 id="基本信息-4"><a href="#基本信息-4" class="headerlink" title="基本信息"></a>基本信息</h4><p><strong>接口名称：</strong>{index}添加索引</p>
<p><strong>接口路径：</strong><a href="http://localhost:9200/{index}" target="_blank" rel="noopener">http://localhost:9200/{index}</a></p>
<ul>
<li>index：索引库</li>
</ul>
<p><strong>请求方式：</strong>PUT</p>
<h4 id="请求参数-4"><a href="#请求参数-4" class="headerlink" title="请求参数"></a>请求参数</h4><p><strong>Headers</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>参数值</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>Content-Type</td>
<td>string</td>
<td>application/json</td>
<td>是</td>
<td>application/json</td>
<td>内容类型：json</td>
</tr>
</tbody></table>
<p><strong>Query</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>Body</strong></p>
<figure class="highlight json"><table><tr><td class="code"><pre><span class="line">&#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"settings"</span>: &#123;	<span class="comment">// 索引库设置</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">    <span class="attr">"index"</span>: &#123;	<span class="comment">// 索引库配置信息</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">      <span class="attr">"number_of_shards"</span>: <span class="number">1</span>,	<span class="comment">// 分片数量(注：单机分片数设置 1)</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">      <span class="attr">"number_of_replicas"</span>: <span class="number">0</span>	<span class="comment">// 副本数量(注：单机副本数设置 0)</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">    &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">  &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">&#125;</span></pre></td></tr></table></figure>

<h4 id="响应数据-4"><a href="#响应数据-4" class="headerlink" title="响应数据"></a>响应数据</h4><figure class="highlight json"><table><tr><td class="code"><pre><span class="line">&#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">    <span class="attr">"acknowledged"</span>: <span class="literal">true</span>,	<span class="comment">// 索引确认状态；true：成功、false：失败</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">    <span class="attr">"shards_acknowledged"</span>: <span class="literal">true</span>,	<span class="comment">// 分配确认状态：true：成功、false：失败</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">    <span class="attr">"index"</span>: <span class="string">"idx_2"</span>	<span class="comment">// 索引名称</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">&#125;</span></pre></td></tr></table></figure>

<h3 id="删除索引"><a href="#删除索引" class="headerlink" title="删除索引"></a>删除索引</h3><h4 id="基本信息-5"><a href="#基本信息-5" class="headerlink" title="基本信息"></a>基本信息</h4><p><strong>接口名称：</strong>{index}删除索引</p>
<p><strong>接口路径：</strong><a href="http://localhost:9200/{index}" target="_blank" rel="noopener">http://localhost:9200/{index}</a></p>
<ul>
<li>index：索引库</li>
</ul>
<p><strong>请求方式：</strong>DELETE</p>
<h4 id="请求参数-5"><a href="#请求参数-5" class="headerlink" title="请求参数"></a>请求参数</h4><p><strong>Headers</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>参数值</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>Query</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>Body</strong></p>
<figure class="highlight json"><table><tr><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="code"><pre><span class="line"></span></pre></td></tr></table></figure>

<h4 id="响应数据-5"><a href="#响应数据-5" class="headerlink" title="响应数据"></a>响应数据</h4><figure class="highlight json"><table><tr><td class="code"><pre><span class="line">&#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">    <span class="attr">"acknowledged"</span>: <span class="literal">true</span>,	<span class="comment">// 索引确认状态；true：成功、false：失败</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">&#125;</span></pre></td></tr></table></figure>

<h2 id="映射"><a href="#映射" class="headerlink" title="映射"></a>映射</h2><h3 id="查看所有索引所有映射"><a href="#查看所有索引所有映射" class="headerlink" title="查看所有索引所有映射"></a>查看所有索引所有映射</h3><h4 id="基本信息-6"><a href="#基本信息-6" class="headerlink" title="基本信息"></a>基本信息</h4><p><strong>接口名称：</strong>_mapping 查看所有映射</p>
<p><strong>接口路径：</strong><a href="http://localhost:9200/_mapping" target="_blank" rel="noopener">http://localhost:9200/_mapping</a></p>
<p><strong>请求方式：</strong>GET</p>
<h4 id="请求参数-6"><a href="#请求参数-6" class="headerlink" title="请求参数"></a>请求参数</h4><p><strong>Headers</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>参数值</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>Query</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>pretty</td>
<td>String</td>
<td>否</td>
<td>true</td>
<td>美化数据</td>
</tr>
</tbody></table>
<p><strong>Body</strong></p>
<figure class="highlight json"><table><tr><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="code"><pre><span class="line"></span></pre></td></tr></table></figure>

<h4 id="响应数据-6"><a href="#响应数据-6" class="headerlink" title="响应数据"></a>响应数据</h4><figure class="highlight json"><table><tr><td class="code"><pre><span class="line">&#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"test"</span>: &#123;	<span class="comment">// 索引库名称</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">    <span class="attr">"mappings"</span>: &#123;	<span class="comment">// 索引库映射</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">      <span class="attr">"doc"</span>: &#123;	<span class="comment">// 索引库类型</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">        <span class="attr">"properties"</span>: &#123;	<span class="comment">// 字段属性</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">          <span class="attr">"desc"</span>: &#123;	<span class="comment">// 字段名</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"type"</span>: <span class="string">"text"</span>	<span class="comment">// 字段类型</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">          &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">          <span class="comment">// 更新字段...</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">      &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">    &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">  &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="comment">// 更多索引库...</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">&#125;</span></pre></td></tr></table></figure>

<h3 id="查看单个索引所有映射"><a href="#查看单个索引所有映射" class="headerlink" title="查看单个索引所有映射"></a>查看单个索引所有映射</h3><h4 id="基本信息-7"><a href="#基本信息-7" class="headerlink" title="基本信息"></a>基本信息</h4><p><strong>接口名称：</strong>{index}/_mapping 查看单个索引所有映射</p>
<p><strong>接口路径：</strong><a href="http://localhost:9200/{index}/_mapping" target="_blank" rel="noopener">http://localhost:9200/{index}/_mapping</a></p>
<ul>
<li>index：索引库</li>
</ul>
<p><strong>请求方式：</strong>GET</p>
<h4 id="请求参数-7"><a href="#请求参数-7" class="headerlink" title="请求参数"></a>请求参数</h4><p><strong>Headers</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>参数值</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>Query</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>pretty</td>
<td>String</td>
<td>否</td>
<td>true</td>
<td>美化数据</td>
</tr>
</tbody></table>
<p><strong>Body</strong></p>
<figure class="highlight json"><table><tr><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="code"><pre><span class="line"></span></pre></td></tr></table></figure>

<h4 id="响应数据-7"><a href="#响应数据-7" class="headerlink" title="响应数据"></a>响应数据</h4><figure class="highlight json"><table><tr><td class="code"><pre><span class="line">&#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"test"</span>: &#123;	<span class="comment">// 索引库名称</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">    <span class="attr">"mappings"</span>: &#123;	<span class="comment">// 索引库映射</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">      <span class="attr">"doc"</span>: &#123;	<span class="comment">// 索引库类型</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">        <span class="attr">"properties"</span>: &#123;	<span class="comment">// 字段属性</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">          <span class="attr">"desc"</span>: &#123;	<span class="comment">// 字段名</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"type"</span>: <span class="string">"text"</span>	<span class="comment">// 字段类型</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">          &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">          <span class="comment">// 更新字段...</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">      &#125;,</span></pre></td></tr><tr><td class="code"><pre><span class="line">      <span class="comment">// 更多类型映射...</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">    &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">  &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">&#125;</span></pre></td></tr></table></figure>

<h3 id="查看单个索引单个映射"><a href="#查看单个索引单个映射" class="headerlink" title="查看单个索引单个映射"></a>查看单个索引单个映射</h3><h4 id="基本信息-8"><a href="#基本信息-8" class="headerlink" title="基本信息"></a>基本信息</h4><p><strong>接口名称：</strong>{index}/{type}/_mapping 查看单个索引单个映射</p>
<p><strong>接口路径：</strong><a href="http://localhost:9200/{index}/{type}/_mapping" target="_blank" rel="noopener">http://localhost:9200/{index}/{type}/_mapping</a></p>
<ul>
<li>Index：索引库</li>
<li>type：类型</li>
</ul>
<p><strong>请求方式：</strong>GET</p>
<h4 id="请求参数-8"><a href="#请求参数-8" class="headerlink" title="请求参数"></a>请求参数</h4><p><strong>Headers</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>参数值</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>Query</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>pretty</td>
<td>String</td>
<td>否</td>
<td>true</td>
<td>美化数据</td>
</tr>
</tbody></table>
<p><strong>Body</strong></p>
<figure class="highlight json"><table><tr><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="code"><pre><span class="line"></span></pre></td></tr></table></figure>

<h4 id="响应数据-8"><a href="#响应数据-8" class="headerlink" title="响应数据"></a>响应数据</h4><figure class="highlight json"><table><tr><td class="code"><pre><span class="line">&#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">  <span class="attr">"test"</span>: &#123;	<span class="comment">// 索引库名称</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">    <span class="attr">"mappings"</span>: &#123;	<span class="comment">// 索引库映射</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">      <span class="attr">"doc"</span>: &#123;	<span class="comment">// 索引库类型</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">        <span class="attr">"properties"</span>: &#123;	<span class="comment">// 字段属性</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">          <span class="attr">"desc"</span>: &#123;	<span class="comment">// 字段名</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"type"</span>: <span class="string">"text"</span>	<span class="comment">// 字段类型</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">          &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">          <span class="comment">// 更新字段...</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">      &#125;,</span></pre></td></tr><tr><td class="code"><pre><span class="line">      <span class="comment">// 更多类型映射...</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">    &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">  &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">&#125;</span></pre></td></tr></table></figure>



<h3 id="添加映射"><a href="#添加映射" class="headerlink" title="添加映射"></a>添加映射</h3><h4 id="基本信息-9"><a href="#基本信息-9" class="headerlink" title="基本信息"></a>基本信息</h4><p><strong>接口名称：</strong> {index}/{type}/_mapping 添加映射</p>
<p><strong>接口路径：</strong><a href="http://localhost:9200/{index}/{type}/_mapping" target="_blank" rel="noopener">http://localhost:9200/{index}/{type}/_mapping</a></p>
<ul>
<li>index：索引库</li>
<li>type：类型</li>
</ul>
<p><strong>请求方式：</strong>POST</p>
<h4 id="请求参数-9"><a href="#请求参数-9" class="headerlink" title="请求参数"></a>请求参数</h4><p><strong>Headers</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>参数值</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>Content-Type</td>
<td>String</td>
<td>application/json</td>
<td>是</td>
<td>application/json</td>
<td>内容类型：json</td>
</tr>
</tbody></table>
<p><strong>Query</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>Body</strong></p>
<figure class="highlight json"><table><tr><td class="code"><pre><span class="line">&#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">	<span class="attr">"properties"</span>: &#123;	<span class="comment">// 映射字段属性</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">		<span class="attr">"name"</span>: &#123;	<span class="comment">// 字段名</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">			<span class="attr">"type"</span>: <span class="string">"text"</span>,	<span class="comment">// 字段类型；text、keyword...</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">      <span class="attr">"analyzer"</span>: <span class="string">"ik_max_word"</span>,	<span class="comment">// 索引分词(粒度越细越好)</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">      <span class="attr">"search_analyzer"</span>: <span class="string">"ik_smart"</span>	<span class="comment">// 搜索分词(粒度越粗越好)</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">		&#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">	&#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">&#125;</span></pre></td></tr></table></figure>

<h4 id="响应数据-9"><a href="#响应数据-9" class="headerlink" title="响应数据"></a>响应数据</h4><figure class="highlight json"><table><tr><td class="code"><pre><span class="line">&#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">    <span class="attr">"acknowledged"</span>: <span class="literal">true</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">&#125;</span></pre></td></tr></table></figure>

<h2 id="分词器"><a href="#分词器" class="headerlink" title="分词器"></a>分词器</h2><h3 id="查看分词"><a href="#查看分词" class="headerlink" title="查看分词"></a>查看分词</h3><h4 id="基本信息-10"><a href="#基本信息-10" class="headerlink" title="基本信息"></a>基本信息</h4><p><strong>接口名称：</strong> _analyze 查看分词</p>
<p><strong>接口路径：</strong><a href="http://localhost:9200/_analyze" target="_blank" rel="noopener">http://localhost:9200/_analyze</a></p>
<p><strong>请求方式：</strong>POST</p>
<h4 id="请求参数-10"><a href="#请求参数-10" class="headerlink" title="请求参数"></a>请求参数</h4><p><strong>Headers</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>参数值</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>Query</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>是否必须</th>
<th>示例</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>Body</strong></p>
<figure class="highlight json"><table><tr><td class="code"><pre><span class="line">&#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">	<span class="attr">"text"</span>:<span class="string">"ElastcSerach 中文搜索服务"</span>,	<span class="comment">// 分词内容</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">	<span class="attr">"analyzer"</span>: <span class="string">"ik_max_word"</span>	<span class="comment">// 分词模式; ik_max_word:细粒度分词、ik_smart：粗粒度分词</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">&#125;</span></pre></td></tr></table></figure>

<p><strong>IK分词器的两种模式</strong></p>
<ul>
<li><code>ik_max_word:</code>会将文本做最细粒度的拆分，比如会将 “ElastcSerach 中文搜索服务” 拆分为 “elastcserach、中文搜索、中文、搜索、服务” 等词语</li>
<li><code>ik_smart:</code>会做最粗粒度的拆分，比如会将 “ElastcSerach 中文搜索服务” 拆分为 “elastcserach、中文搜索、服务”</li>
</ul>
<h4 id="响应数据-10"><a href="#响应数据-10" class="headerlink" title="响应数据"></a>响应数据</h4><p><strong>ik_max_word 细粒度分词</strong></p>
<figure class="highlight json"><table><tr><td class="code"><pre><span class="line">&#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">    <span class="attr">"tokens"</span>: [</span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"token"</span>: <span class="string">"elastcserach"</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"start_offset"</span>: <span class="number">0</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"end_offset"</span>: <span class="number">12</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"type"</span>: <span class="string">"ENGLISH"</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"position"</span>: <span class="number">0</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#125;,</span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"token"</span>: <span class="string">"中文搜索"</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"start_offset"</span>: <span class="number">13</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"end_offset"</span>: <span class="number">17</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"type"</span>: <span class="string">"CN_WORD"</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"position"</span>: <span class="number">1</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#125;,</span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"token"</span>: <span class="string">"中文"</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"start_offset"</span>: <span class="number">13</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"end_offset"</span>: <span class="number">15</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"type"</span>: <span class="string">"CN_WORD"</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"position"</span>: <span class="number">2</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#125;,</span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"token"</span>: <span class="string">"搜索"</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"start_offset"</span>: <span class="number">15</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"end_offset"</span>: <span class="number">17</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"type"</span>: <span class="string">"CN_WORD"</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"position"</span>: <span class="number">3</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#125;,</span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"token"</span>: <span class="string">"服务"</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"start_offset"</span>: <span class="number">17</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"end_offset"</span>: <span class="number">19</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"type"</span>: <span class="string">"CN_WORD"</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"position"</span>: <span class="number">4</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">    ]</span></pre></td></tr><tr><td class="code"><pre><span class="line">&#125;</span></pre></td></tr></table></figure>

<p><strong>ik_smart 粗粒度分词</strong></p>
<figure class="highlight json"><table><tr><td class="code"><pre><span class="line">&#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">    <span class="attr">"tokens"</span>: [</span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"token"</span>: <span class="string">"elastcserach"</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"start_offset"</span>: <span class="number">0</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"end_offset"</span>: <span class="number">12</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"type"</span>: <span class="string">"ENGLISH"</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"position"</span>: <span class="number">0</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#125;,</span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"token"</span>: <span class="string">"中文搜索"</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"start_offset"</span>: <span class="number">13</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"end_offset"</span>: <span class="number">17</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"type"</span>: <span class="string">"CN_WORD"</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"position"</span>: <span class="number">1</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#125;,</span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#123;</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"token"</span>: <span class="string">"服务"</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"start_offset"</span>: <span class="number">17</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"end_offset"</span>: <span class="number">19</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"type"</span>: <span class="string">"CN_WORD"</span>,</span></pre></td></tr><tr><td class="code"><pre><span class="line">            <span class="attr">"position"</span>: <span class="number">2</span></span></pre></td></tr><tr><td class="code"><pre><span class="line">        &#125;</span></pre></td></tr><tr><td class="code"><pre><span class="line">    ]</span></pre></td></tr><tr><td class="code"><pre><span class="line">&#125;</span></pre></td></tr></table></figure>




      
    </div>
    <div class="article-footer">
      <blockquote class="mt-2x">
  <ul class="post-copyright list-unstyled">
    
    <li class="post-copyright-link hidden-xs">
      <strong>本文链接：</strong>
      <a href="http://jirenyou.gitee.io/blog/2020/01/02/elasticsearch/es-rest-api/" title="ElasticSearch RestFul API接口" target="_blank" rel="external">http://jirenyou.gitee.io/blog/2020/01/02/elasticsearch/es-rest-api/</a>
    </li>
    
    <li class="post-copyright-license">
      <strong>版权声明： </strong> 本博客所有文章除特别声明外，均采用 <a href="http://creativecommons.org/licenses/by/4.0/deed.zh" target="_blank" rel="external">CC BY 4.0 CN协议</a> 许可协议。转载请注明出处！
    </li>
  </ul>
</blockquote>


<div class="panel panel-default panel-badger">
  <div class="panel-body">
    <figure class="media">
      <div class="media-left">
        <a href="https://jirenyou.gitee.io/blog" target="_blank" class="img-burn thumb-sm visible-lg">
          <img src="/blog/images/avatar.jpg" class="img-rounded w-full" alt="">
        </a>
      </div>
      <div class="media-body">
        <h3 class="media-heading"><a href="https://jirenyou.gitee.io/blog" target="_blank"><span class="text-dark">Jirry</span><small class="ml-1x">Back end development Architecture</small></a></h3>
        <div>后端开发攻城狮，热爱互联网技术，爱学习，勤思考！</div>
      </div>
    </figure>
  </div>
</div>


    </div>
  </article>
  
    
  <section id="comments">
  	
      <div id="vcomments"></div>
    
  </section>


  
</div>

  <nav class="bar bar-footer clearfix" data-stick-bottom>
  <div class="bar-inner">
  
  <ul class="pager pull-left">
    
    <li class="prev">
      <a href="/blog/2020/01/02/elasticsearch/es-desc/" title="ElasticSearch 入门介绍"><i class="icon icon-angle-left" aria-hidden="true"></i><span>&nbsp;&nbsp;上一篇</span></a>
    </li>
    
    
    <li class="next">
      <a href="/blog/2019/12/31/docker/docker-container-volumes-edit/" title="Docker 已创建容器挂载目录"><span>下一篇&nbsp;&nbsp;</span><i class="icon icon-angle-right" aria-hidden="true"></i></a>
    </li>
    
    
    <li class="toggle-toc">
      <a class="toggle-btn collapsed" data-toggle="collapse" href="#collapseToc" aria-expanded="false" title="文章目录" role="button">
        <span>[&nbsp;</span><span>文章目录</span>
        <i class="text-collapsed icon icon-anchor"></i>
        <i class="text-in icon icon-close"></i>
        <span>]</span>
      </a>
    </li>
    
  </ul>
  
  
  <!-- Button trigger modal -->
  <button type="button" class="btn btn-fancy btn-donate pop-onhover bg-gradient-warning" data-toggle="modal" data-target="#donateModal"><span>赏</span></button>
  <!-- <div class="wave-icon wave-icon-danger btn-donate" data-toggle="modal" data-target="#donateModal">
    <div class="wave-circle"><span class="icon"><i class="icon icon-bill"></i></span></div>
  </div> -->
  
  
  <div class="bar-right">
    
    <div class="share-component" data-sites="weibo,qq,wechat,facebook,twitter" data-mobile-sites="weibo,qq,qzone"></div>
    
  </div>
  </div>
</nav>
  
<!-- Modal -->
<div class="modal modal-center modal-small modal-xs-full fade" id="donateModal" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content donate">
      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
      <div class="modal-body">
        <div class="donate-box">
          <div class="donate-head">
            <p>感谢您的支持，我会继续努力的!</p>
          </div>
          <div class="tab-content">
            <div role="tabpanel" class="tab-pane fade active in" id="alipay">
              <div class="donate-payimg">
                <img src="/blog/images/donate/alipay.jpeg" alt="扫码支持" title="扫一扫" />
              </div>
              <p class="text-muted mv">扫码打赏，你说多少就多少</p>
              <p class="text-grey">打开支付宝扫一扫，即可进行扫码打赏哦</p>
            </div>
            <div role="tabpanel" class="tab-pane fade" id="wechatpay">
              <div class="donate-payimg">
                <img src="/blog/images/donate/wechat.jpeg" alt="扫码支持" title="扫一扫" />
              </div>
              <p class="text-muted mv">扫码打赏，你说多少就多少</p>
              <p class="text-grey">打开微信扫一扫，即可进行扫码打赏哦</p>
            </div>
          </div>
          <div class="donate-footer">
            <ul class="nav nav-tabs nav-justified" role="tablist">
              <li role="presentation" class="active">
                <a href="#alipay" id="alipay-tab" role="tab" data-toggle="tab" aria-controls="alipay" aria-expanded="true"><i class="icon icon-alipay"></i> 支付宝</a>
              </li>
              <li role="presentation" class="">
                <a href="#wechatpay" role="tab" id="wechatpay-tab" data-toggle="tab" aria-controls="wechatpay" aria-expanded="false"><i class="icon icon-wepay"></i> 微信支付</a>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>



</main>

  <footer class="footer" itemscope itemtype="http://schema.org/WPFooter">
	
	
    <ul class="social-links">
    	
        <li><a href="https://github.com/jirryji" target="_blank" title="Github" data-toggle=tooltip data-placement=top><i class="icon icon-github"></i></a></li>
        
        <li><a href="https://weibo.com/7355950025" target="_blank" title="Weibo" data-toggle=tooltip data-placement=top><i class="icon icon-weibo"></i></a></li>
        
        <li><a href="/blog/atom.xml" target="_blank" title="Rss" data-toggle=tooltip data-placement=top><i class="icon icon-rss"></i></a></li>
        
    </ul>

    <div class="copyright">
    	
        &copy; 2020 Jirry
        
        <div class="publishby">
        	Theme by <a href="https://github.com/cofess" target="_blank"> cofess </a>base on <a href="https://github.com/cofess/hexo-theme-pure" target="_blank">pure</a>.
        </div>
    </div>
</footer>
  <script src="//cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')
</script>

<script src="/blog/js/plugin.min.js"></script>


<script src="/blog/js/application.js"></script>


    <script>
(function (window) {
    var INSIGHT_CONFIG = {
        TRANSLATION: {
            POSTS: '文章',
            PAGES: '页面',
            CATEGORIES: '分类',
            TAGS: '标签',
            UNTITLED: '(未命名)',
        },
        ROOT_URL: '/blog/',
        CONTENT_URL: '/blog/content.json',
    };
    window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
</script>

<script src="/blog/js/insight.js"></script>






   
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>





   
    
  <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/valine"></script>
  <script type="text/javascript">
  var GUEST = ['nick', 'mail', 'link'];
  var meta = 'nick,mail,link';
  meta = meta.split(',').filter(function(item) {
    return GUEST.indexOf(item) > -1;
  });
  new Valine({
    el: '#vcomments',
    verify: false,
    notify: false,
    appId: '',
    appKey: '',
    placeholder: 'Just go go',
    avatar: 'mm',
    meta: meta,
    pageSize: '10' || 10,
    visitor: false
  });
  </script>

     







</body>
</html>